<%@ page language="java"
	import="java.util.*,com.tjsinfo.tjsoa.common.PaginationSupport"
	pageEncoding="UTF-8"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.tjsinfo.tjsoa.meetingroom.vo.MeetingRoomEmploy"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	PaginationSupport paginationSupport = (PaginationSupport) request.getAttribute("empolyList");
	String roomId = (String) request.getAttribute("roomId");
	String roomName = (String) request.getAttribute("roomName");
	String datetime = (String) request.getAttribute("datetime");
	List<String> datetimeList = (List<String>) request.getAttribute("datetimeList");
	List<MeetingRoomEmploy> infos = paginationSupport.getItems();
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<html:base />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>粮油集团协同办公平台</title>
		
		<link rel="stylesheet" type="text/css" href="<%=basePath%>ajaxFramework/ext-2.1/resources/css/ext-all.css" />
		<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
	  	<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/ext-all.js"></script>
		<script type="text/javascript" src="<%=basePath %>ajaxFramework/ext-2.1/source/locale/ext-lang-zh_CN.js"></script>
		<style>
#container {
	width: 600px;
	height: 300px;
	border: 3px solid #c3daf9;
}

.calendar {
	background-image: url(<%=basePath%>images/icon_64.gif) !important;
}

.blist {
	background-image: url(<%=basePath%>images/icon_64.gif) !important;
}

.bmenu {
	background-image: url(<%=basePath%>images/ju.gif) !important;
}

.menu-title {
	background: #ebeadb url(<%=basePath%>images/icon_64.gif) repeat-x;
	border-bottom: 1px solid #99bbe8;
	color: #15428b;
	font: bold 10px tahoma, arial, verdana, sans-serif;
	display: block;
	padding: 3px;
}

.lan01 {
	background: url(<%=basePath%>images/lanbg01.gif) no-repeat 0 0;
	width: 6px;
	height: 24px;
}

.lan02 {
	background: url(<%=basePath%>images/lanbg02.gif) repeat-x;
	width: 99%;
	height: 24px;
}

.lan03 {
	background: url(<%=basePath%>images/lanbg03.gif) no-repeat;
	width: 8px;
	height: 24px;
}

.cha {
	padding-top: 3px
}
</style>
		<link href="<%=basePath%>style/txlz7.css" rel="stylesheet"
			type="text/css" />
		<script type="text/javascript" src="<%=basePath%>js/ieverson.js"></script>
		<script type="text/javascript">
 		function submitform1(value){
			document.form1.submit();
		}
		window.onload = function(){
			var tb = new Ext.Toolbar(
				{
					height:25
				}
			);
		
		    tb.render('menu');
			tb.add(
		    {
		            text:'返回',
		            iconCls: 'daohang',
		        	handler: function(){
		        		location.href="<%=basePath%>tjsinfo/tjsoa/meetingroom/empolyRoomList.do";
					}
		    }
		    );
			tb.addFill();
		    tb.addText('<img id="windowResize" src="<%=basePath%>images/m_icon05.gif;"><a style="font-weight:bold; color:black;line-height: 22px;"><%=roomName %>会议室审批</a>&nbsp;&nbsp;&nbsp;');
		}
	    </script>
	</head>
	<body>
		<div id="right">
		<div id="menu" style="padding-top:4px;"></div>
		<div style="height: 91%;">
			<form action="<%=basePath%>tjsinfo/tjsoa/meetingroom/empolyList.do" method="post" name="form1">
				<input id="roomId" name="roomId" type="hidden" value="<%=roomId %>"/>
				<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%" style="background:#fff;">
					<tr>
						<td width="100%" align="left">
							<div style="margin-top: 5px;">
							&nbsp;&nbsp;会议时间：
							<select id="datetime" name="datetime" onchange="submitform1();">
							<%
							for (Iterator iterator = datetimeList.iterator(); iterator.hasNext();) {
								String date = (String) iterator.next();
							%>
							<option value="<%=date %>" <%if(datetime.equals(date))out.print("selected"); %>><%=date %></option>
							<%
							}
							%>
							</select>
							</div>
						</td>
					</tr>
					<tr>
						<td width="100%" valign="top" height="95%">
							<div class="contabwd">
								<table class="p_06" width="100%" border="0" cellspacing="0">
									<tr>
										<th width="20%" style="text-align: center">
											申请时间
										</th>
										<th width="20%" style="text-align: center">
											申请部门及人员
										</th>
										<th width="20%" style="text-align: center">
											会议名称
										</th>
										<th width="20%" style="text-align: center">
											开始时间及时间段
										</th>
										<th width="10%" style="text-align: center">
											持续时间
										</th>
										<th width="10%"style="text-align: center">
											操作
										</th>
									</tr>
									<%
										int a = 1;
										for (Iterator iterator = infos.iterator(); iterator.hasNext();) {
											MeetingRoomEmploy mre = (MeetingRoomEmploy) iterator.next();
											String name = mre.getMeetingName();
											if(mre.getMeetingName().length()>7)mre.setMeetingName(name.substring(0,7));
											if(mre.getMeetingRoomMain().getMeetingroomName().length()>7)mre.getMeetingRoomMain().setMeetingroomName(roomName.substring(0,7));
											String place = mre.getMeetingRoomMain().getPlace();
											if(mre.getMeetingRoomMain().getPlace().length()>13)mre.getMeetingRoomMain().setPlace(place.substring(0,13));
											if (a % 2 == 0) {
									%>
									<tr bgcolor="#F4F4F4">
										<td><%=mre.getEmpolyTime() %></td>
										<td><%=mre.getBumen() %>&nbsp;<%=mre.getApplicationUserName() %></td>
										<td><a title="<%=name %>" href="<%=basePath%>tjsinfo/tjsoa/meetingroom/empolySpecific.do?&id=<%=mre.getId() %>"><%=mre.getMeetingName() %></a></td>
										<td><%=sdf.format(mre.getStartTime()) %>&nbsp;<%=mre.getRemarks() %></td>
										<td><%=mre.getEndTime() %>小时</td>
										<td>
											<a href="<%=basePath%>tjsinfo/tjsoa/meetingroom/empolySpecific.do?&id=<%=mre.getId() %>">审批</a>&nbsp;&nbsp;
											<a href="<%=basePath%>tjsinfo/tjsoa/meetingroom/dengjibiao.do?method=guanlidengjibiao&riqi=<%=mre.getMeetingTime() %>">登记表</a>
                                      	</td>
									</tr>
									<%
										} else {
									%>
									<tr>
										<td><%=mre.getEmpolyTime() %></td>
										<td><%=mre.getBumen() %>&nbsp;<%=mre.getApplicationUserName() %></td>
										<td><a title="<%=name %>" href="<%=basePath%>tjsinfo/tjsoa/meetingroom/empolySpecific.do?&id=<%=mre.getId() %>"><%=mre.getMeetingName() %></a></td>
										<td><%=sdf.format(mre.getStartTime()) %>&nbsp;<%=mre.getRemarks() %></td>
										<td><%=mre.getEndTime() %>小时</td>
										<td>
											<a href="<%=basePath%>tjsinfo/tjsoa/meetingroom/empolySpecific.do?&id=<%=mre.getId() %>">审批</a>&nbsp;&nbsp;
											<a href="<%=basePath%>tjsinfo/tjsoa/meetingroom/dengjibiao.do?method=guanlidengjibiao&riqi=<%=mre.getMeetingTime() %>">登记表</a>
                                      	</td>
									</tr>
									<%
										}
											a++;
										}
									%>

									<tr align="center">
										<td colspan="6" style="border-bottom: 1px #d0d0d0 solid">
											<div class="page01">
											</div>
										</td>
									</tr>
								</table>
								</div>
						</td>
					</tr>
				</table>
				</form>
			</div>
			</div>
	</body>
</html>
